<?php
/*
|---------------------------------------------------------------
| PHP BEGIN
|---------------------------------------------------------------
|
| INHERIT FROM CODEIGNITER FRAMEWORK. 
|
*/
if (floor(phpversion()) < 5)
{
	die('Requires PHP version 5 or higher. After you have satisfied this, you can try begin with my application again.');
}

	error_reporting(E_ALL);
	$system_folder = "ap_application";
	$application_folder = "application";
	 
	if (strpos($system_folder, '/') === FALSE)
	{
		if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
		{
			$system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
		}
	}
	else
	{
		// Swap directory separators to Unix style for consistency
		$system_folder = str_replace("\\", "/", $system_folder); 
	}

	define('ROOTPATH', 'file:///' . realpath(dirname(__FILE__)));
	define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
	define('FCPATH', __FILE__);
	define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
	define('BASEPATH', $system_folder.'/');
	define('HELPPATH', $system_folder.'/'.'help');

	if (is_dir($application_folder))
	{
		define('APPPATH', $application_folder.'/');
	}
	else
	{
		if ($application_folder == '')
		{
			$application_folder = 'application';
		}
	
		define('APPPATH', BASEPATH.$application_folder.'/');
	}
	// Begin application start here
	require_once BASEPATH.'code_base/CodeIgniter'.EXT;
